package com.example.imtoken.core.binding

import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.databinding.BindingAdapter
import com.example.imtoken.R

object ViewAttributeBindingAdapter {

    @JvmStatic
    @BindingAdapter("manageWalletBackground")
    fun setManageWalletBackground(layout: ConstraintLayout, coin: String?) {
        when (coin) {
            "eth" -> layout.setBackgroundResource(R.drawable.shape_manage_wallet_eth)
            "trx" -> layout.setBackgroundResource(R.drawable.shape_manage_wallet_trx)
        }
    }

    @JvmStatic
    @BindingAdapter("manageWalletCoinLogo")
    fun setManageWalletCoinLogo(imageView: ImageView, coin: String?) {
        when (coin) {
            "eth" -> imageView.setImageResource(R.mipmap.src_lib_eui_icon_ethereumbadge)
            "trx" -> imageView.setImageResource(R.mipmap.src_lib_eui_icon_tronbadge)
        }
    }
}